{extend name="default/template/base_index" /}


{block name="area_header"}
  <link src="__CDN__/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css" rel="stylesheet" type="text/css" />

    <!--<link type="text/css" rel="stylesheet" href="__CDN__/select2/4.0.0/css/select2.min.css" />
  <script type="text/javascript" src="__CDN__/select2/4.0.0/js/select2.full.js"></script>
  <script type="text/javascript" src="__CDN__/select2/4.0.0/js/i18n/zh-CN.js"></script>
  <link type="text/css" rel="stylesheet" href="__CDN__/select2/4.0.0/css/cosmo-skin.css" />-->

    <link rel="stylesheet" type="text/css" href="__CDN__/comp/wxuploader.css" />
    <link type="text/css" rel="stylesheet" href="__CDN__/jquery-uploadify/3.2.1/uploadify.css" />
    <script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>
{/block}

{block name="area_body"}
    {include file="default/Widget/topbar" /}
    <div class="admin-main container-fluid">
        {include file="default/Widget/left" /}
        <div class="admin-main-content">
            {include file="default/Widget/breadcrumb" /}
            <!-- form -->
            <form class="form-horizontal well validateForm">
                <input type="hidden" value="{$view.id}" name="id"/>
                <fieldset>
                    <legend>
                        会员等级更新</legend>
                    <div class="form-group">
                        <label for="name" class="col-md-2 col-lg-2 control-label">等级名称</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="text" class="required form-control input-short" name="name" id="name" value="{$view.name}" placeholder="请输入等级名称" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="iconurl" class="col-md-2 col-lg-2 control-label">图片地址{$view.iconurl}</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="hidden" class="" name="iconurl" id="iconurl" placeholder="请给图片起个标题或默认">
                            <!-- 图片选择DOM结构 -->
                            <div class="wxuploaderimg clearfix banner <notempty name="view.iconurl">checked{/notempty}" data-maxitems="1">
                            <div class="img-preview clearfix" >
                                <notempty name="view.iconurl">
                                    <div class="pull-left clearfix img-item">
                                        <img src="{:url('Api/Picture/index',array('id'=>$view['iconurl']))}" />
                                        <div class="edit_pic_wrp"><a href="javascript:;" class="fa fa-lg fa-trash js_delete"></a></div>
                                    </div>
                                {/notempty}
                            </div>
                            <div class="add">
                                <i class="fa fa-plus"></i>
                            </div>
                        </div>
                        <!-- 图片选择DOM结构 -->

                        <div class="help-block">(上传等级图标)</div>
                    </div>





                    <div class="form-group">
                        <label for="remark" class="col-md-2 col-lg-2 control-label">等级描述</label>
                        <div class="col-md-10 col-lg-10">
                            <textarea name="remark" id="remark" class="form-control" rows="5" >{$view.remark}</textarea>
                            <div class="help-block">(您可以输入内容)</div>
                        </div>
                    </div>


                    <div class="form-group " >
                        <label for="discount_ratio" class="col-md-2 col-lg-2 control-label">优惠比例</label>
                        <div class="col-md-10 col-lg-10" >
                            <input type="text" class="required  input-short" style="padding: 6px;border-radius: 5px;border: 1px solid #ccc" name="discount_ratio" id="discount_ratio" value="{$view['discount_ratio']*100}"  placeholder="请输入优惠比例" >%
                            <span class="help-block" style="clear: both">(请输入返佣比例,单位%)</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="commission_ratio" class="col-md-2 col-lg-2 control-label">返佣比例</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="text" class="required input-short" style="padding: 6px;border-radius: 5px;border: 1px solid #ccc" name="commission_ratio" id="commission_ratio"  value="{$view['commission_ratio']*100}"  placeholder="请输入返佣比例" >%
                            <span class="help-block" style="clear: both">(请输入返佣比例,单位%)</span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="conditions" class="col-md-2 col-lg-2 control-label">条件</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="text" class="required input-normal" style="padding: 6px;border-radius: 5px;border: 1px solid #ccc" name="conditions" id="conditions" value="{$view.conditions}" placeholder="请输入达成成交单数" >
                            <span class="help-block" style="clear: both">(请输入达成成交单数)</span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="btns" class="col-md-2 col-lg-2 control-label">&nbsp;</label>
                        <div class="col-lg-10 col-md-10">
                            <a target-form="validateForm" class="ajax-post btn btn-primary" onclick="return getData();"  href="{:url('MemberGroup/groupUpdate')}" autofocus="autofocus"><i class="fa fa-save"></i> {:L('BTN_SAVE')}</a>
                            <a class="btn btn-default" href="{:url('MemberGroup/groupIndex')}"><i class="fa fa-times-circle"></i>{:L('BTN_BACK')}</a>
                        </div>
                    </div>
                </fieldset>
            </form>
            <!-- form -->
            {include file="default/template/wxpicture" /}
        </div>

    </div>
{/block}

{block name="area_footer"}
    <script type="text/javascript">
        function getData(){
            var img = $(".wxuploaderimg img").attr("data-imageid");
            $("#iconurl").val(img);
            return true;
        }

        $(function(){
            wxuploadimg.init({cont:".wxuploaderimg"});
        });
    </script>
{/block}